<%--
  Created by IntelliJ IDEA.
  User: 今天要吃三碗饭
  Date: 2025/1/2
  Time: 18:14
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>添加商品</title>
    <style>
        body {
            font-family: 'Arial', sans-serif;
            background-color: #f4f4f4;
            margin: 0;
            padding: 0;
        }
        .container {
            max-width: 600px;
            margin: 50px auto;
            padding: 20px;
            background-color: #fff;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
        }
        h2 {
            text-align: center;
            margin-bottom: 20px;
        }
        form {
            display: flex;
            flex-direction: column;
        }
        label {
            margin-bottom: 5px;
        }
        input[type="text"],
        select,
        input[type="file"] {
            padding: 10px;
            margin-bottom: 10px;
            border: 1px solid #ccc;
            border-radius: 4px;
        }
        input[type="submit"] {
            padding: 10px 20px;
            background-color: #5cb85c;
            color: white;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            transition: background-color 0.3s;
        }
        input[type="submit"]:hover {
            background-color: #4cae4c;
        }
    </style>
</head>
<body>
<div class="container">
    <h2>添加商品</h2>
    <form action="<%=request.getContextPath()%>/add" method="post" enctype="multipart/form-data">
        <label for="id">商品id:</label>
        <input type="text" id="id" name="id"  required placeholder="请输入商品id" value="" />
        <label for="name">商品名称：</label>
        <input type="text" id="name" name="name" required placeholder="请输入商品名称" value="">

        <label for="price">商品价格：</label>
        <input type="text" id="price" name="price" required placeholder="请输入商品价格" value="">

        <label for="type">商品类别：</label>
        <select id="type" name="type">
            <option value="手机">手机</option>
            <option value="笔记本">笔记本</option>
            <option value="电脑">电脑</option>
            <option value="书籍">书籍</option>
        </select>

        <label for="photo">商品图片：</label>
        <input type="file" id="photo" name="photo" required>

        <input type="submit" value="上架">
    </form>
</div>
</body>
</html>
